package com.ruoyi.lyy.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.lyy.domain.vo.CouponVO;
import com.ruoyi.lyy.service.ICouponService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author YueYang
 * Created on 2025/11/17 21:40
 * @version 1.0
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/coupon")
public class CouponController {
    private final ICouponService couponService;

    @GetMapping("/{uid}")
    public AjaxResult getCouponInfoByUid(@PathVariable("uid") Integer uid) {
        List<CouponVO> couponVOS = couponService.getCouponInfoByUid(uid);
        return AjaxResult.success("查询优惠券信息成功", couponVOS);
    }
}
